Support for multi-PR analysis#113
Conversation
Signed-off-by: Bala Tripura Kumari Bodapati <bbodapat@redhat.com>
Signed-off-by: Bala Tripura Kumari Bodapati <bbodapat@redhat.com>
There was a problem hiding this comment.
Pull request overview
Adds support for analyzing multiple GitHub PRs in a single “analyze pr:” request, producing per-PR impact/regression sections and side-by-side metric tables when applicable.
Changes:
- Extend PR request parsing to accept multiple PR URLs (same org/repo) and propagate PR lists through the analysis pipeline.
- Update the Gemini prompt to describe multi-PR tool-calling and multi-PR output/table formatting.
- Add unit tests for multi-PR parsing and Gemini output sanitization.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tests/test_pr_analyzer.py |
Adds tests for single/multi-PR request parsing and output sanitization. |
bugzooka/integrations/slack_socket_listener.py |
Updates logging to handle multiple PR numbers in pr_info. |
bugzooka/analysis/prompts.py |
Updates the PR analysis prompt to include multi-PR tool-calling and output rules. |
bugzooka/analysis/pr_analyzer.py |
Implements multi-PR parsing and updates analysis prompt construction/logging accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Bala Tripura Kumari Bodapati <bbodapat@redhat.com>
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds multi-PR support: parser extracts and validates multiple GitHub PR numbers and required version; prompt template accepts {pr_numbers}/{pr_urls}; analyze_pr_with_gemini injects comma-separated PR lists and returns pr_numbers list; Slack logging updated; tests added for parsing and sanitization. ChangesMulti-PR Performance Analysis
🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
bugzooka/analysis/pr_analyzer.py (1)
52-52: 💤 Low valueConsider more specific type hint for the return value.
The return type uses generic
listinstead oflist[str]. Python 3.9+ supports parameterized generics in standard collections.♻️ Suggested type hint improvement
-def _parse_pr_request(text: str) -> Optional[Tuple[str, str, list, str]]: +def _parse_pr_request(text: str) -> Optional[Tuple[str, str, list[str], str]]:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bugzooka/analysis/pr_analyzer.py` at line 52, The return type annotation for _parse_pr_request is too generic (uses list); change it to a parameterized generic to reflect element types, e.g. update the signature from Optional[Tuple[str, str, list, str]] to Optional[Tuple[str, str, list[str], str]] (or typing.List[str] if targeting older Python versions) so callers know the list contains strings; keep the rest of the signature and imports (Optional, Tuple) as-is or add List from typing if you choose typing.List.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@bugzooka/analysis/pr_analyzer.py`:
- Line 52: The return type annotation for _parse_pr_request is too generic (uses
list); change it to a parameterized generic to reflect element types, e.g.
update the signature from Optional[Tuple[str, str, list, str]] to
Optional[Tuple[str, str, list[str], str]] (or typing.List[str] if targeting
older Python versions) so callers know the list contains strings; keep the rest
of the signature and imports (Optional, Tuple) as-is or add List from typing if
you choose typing.List.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: b005f0d1-4887-44f2-9a8b-d143e336f8ba
📒 Files selected for processing (4)
bugzooka/analysis/pr_analyzer.pybugzooka/analysis/prompts.pybugzooka/integrations/slack_socket_listener.pytests/test_pr_analyzer.py
Description
Example:
analyze pr: https://github.com/openshift/ovn-kubernetes/pull/3169 https://github.com/openshift/ovn-kubernetes/pull/3170, compare with 5.0Related PRS:
Orion-mcp PR to support multi-PR analysis
Orion PR to support multi-PR analysis
Testing
Tested locally, the following is the output:



